//
//  AuthUploadPhoneViewController.m
//  RENTVISITOR
//
//  Created by wonder on 2017/8/31.
//  Copyright © 2017年 UNN. All rights reserved.
//

#import "AuthUploadPhoneViewController.h"
#import "RentVieitor.h"
#import "PhoneUploadViewController.h"

@interface AuthUploadPhoneViewController ()

@end

@implementation AuthUploadPhoneViewController

- (void)viewWillAppear:(BOOL)animated {
    
    [self.navigationController.navigationBar setShadowImage:[[UIImage alloc] init]];
    self.navigationController.navigationBar.translucent = NO;
    self.navigationController.navigationBar.hidden = NO;
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"上传照片";
    self.view.backgroundColor = BackgroundColor;
    [self creatLeftView];
    [self creatView];
}

- (void)creatLeftView {
    
    // 自定义导航栏左侧按钮
    UIButton * leftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    leftBtn.frame = CGRectMake(0, 0, 100,15 );
    [leftBtn setImage:[UIImage imageNamed:@"箭头左"] forState:UIControlStateNormal];
    [leftBtn setTitle:@"经纪人认证" forState:UIControlStateNormal];
    leftBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    [leftBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, 10, 0, 0)];
    leftBtn.titleLabel.font = [UIFont systemFontOfSize:14];
    [leftBtn setTitleColor:[Utils colorConvertFromString:@"#333333"] forState:UIControlStateNormal];
    [leftBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem * leftItem = [[UIBarButtonItem alloc] initWithCustomView:leftBtn];
    self.navigationItem.leftBarButtonItem = leftItem;
    
}

- (void)creatView {
    
    UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 265/2, KWidth, 30)];
    textLabel.text = [NSString stringWithFormat:@"你需要上传身份证正面,反面,手持身份证照片共三张"];
    textLabel.textColor = [Utils colorConvertFromString:@"#666666"];
    textLabel.font = [UIFont boldSystemFontOfSize:13];
    textLabel.textAlignment = NSTextAlignmentCenter;
    textLabel.numberOfLines = 0;
    [self.view addSubview:textLabel];
    
    UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake((KWidth-100)/2, 265/2+30+35, 100, 100*202/247)];
    imgView.image = [UIImage imageNamed:@"aunth-图片"];
    [self.view addSubview:imgView];
    
    UILabel *sizeLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,  265/2+30+35+100*202/247+13, KWidth, 20)];
    sizeLabel.text = [NSString stringWithFormat:@"(建议图片大小600K以内)"];
    sizeLabel.textColor = [Utils colorConvertFromString:@"#666666"];
    sizeLabel.font = [UIFont boldSystemFontOfSize:11];
    sizeLabel.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:sizeLabel];

    UIButton *changeBtn = [UIButton buttonWithType:UIButtonTypeSystem];
    changeBtn.frame = CGRectMake((KWidth-135)/2,265/2+30+35+100*202/247+13+20+45, 135, 40);
    [changeBtn setBackgroundColor:[Utils colorConvertFromString:@"#1fae0c"]];
    [changeBtn setTitle:@"点击上传" forState:UIControlStateNormal];
    [changeBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    changeBtn.layer.masksToBounds = YES;
    [changeBtn addTarget:self action:@selector(submitAction) forControlEvents:UIControlEventTouchUpInside];
    changeBtn.layer.cornerRadius = 2;
    [self.view addSubview:changeBtn];
}

- (void)submitAction {
    
    PhoneUploadViewController *phoneVc = [[PhoneUploadViewController alloc] init];
    [self.navigationController pushViewController:phoneVc animated:YES];
}

- (void)backAction {
    
    [self.navigationController popViewControllerAnimated:YES];
}

@end
